//
//  Film.m
//  Film
//
//  Created by dllo on 16/3/5.
//  Copyright © 2016年 Apon. All rights reserved.
//

#import "Film.h"

@implementation Film
#pragma mark - 重写dealloc方法
- (void)dealloc {
    [_title release];
    [_picUrl release];
    [_summary release];
    NSLog(@"Game Over");
    [super dealloc];
}

#pragma mark - Creating and init
- (instancetype)initWithTitle:(NSString *)title picUrl:(NSString *)picUrl summary:(NSString *)summary {
    self = [super init];
    if (self) {
        _title = [title copy];
        _picUrl = [picUrl copy];
        _summary = [summary copy];
    }
    return self;
}

+ (instancetype)filmWithWithTitle:(NSString *)title picUrl:(NSString *)picUrl summary:(NSString *)summary {
    return [[[Film alloc]initWithTitle:title picUrl:picUrl summary:summary] autorelease];
}

#pragma mark - 重写description
- (NSString *)description {
    return [NSString stringWithFormat:@"Title: %@, PicUrl: %@, Summary: %@", self.title ,self.picUrl, self.summary];
}
@end
